/**
 * 扫码页面
 */
import 'package:flutter_benchu/utils/commonPkg.dart';
import 'package:flutter_qr_reader/qrcode_reader_view.dart';

class ScannerPage extends StatefulWidget {
  @override
  _ScannerPageState createState() => _ScannerPageState();
}

class _ScannerPageState extends State<ScannerPage> {
  final GlobalKey<QrcodeReaderViewState> qrViewKey = GlobalKey();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: QrcodeReaderView(
          headerWidget: AppBar(
            iconTheme: IconThemeData(color: Colors.white),
            // leading: Utils.buildDefaultBackIcon(context),
            backgroundColor: Colors.transparent,
          ),
          key: qrViewKey,
          // helpWidget: Text(text(context, Ids.tabHome)),
          onScan: (String data) async {
            Navigator.pop(context, data);
          }),
    );
  }
}
